﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CaseViewDetails.ascx.cs"
    Inherits="Reconciliation.Web.Users_Control.CaseViewDetails" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

    <script type="text/javascript">
            function OpenExpectedReturn()
            {
               id = document.getElementById('lblOrderID').innerText;
                
              window.radopen("ExpectedReturn.aspx?OrderID=" + id, "RadWindowExpectedReturn");
                return false; 
            } 
            
            function ViewClientCommentTextBox() {

            //document.getElementById("divEnterClientComment").style.display = "block";
            var linkbtn = document.getElementById("lnkAddClientComment");
            linkbtn.style.display = "none";
            return false;

            }
            function ViewAuditorCommentTextBox() {

                //document.getElementById("divEnterClientComment").style.display = "block";
                var linkbtn = document.getElementById("lnkAddAuditorComment");
                linkbtn.style.display = "none";
                return false;
            }
            function ViewUploadFile() {

                document.getElementById("divUploadFile").style.display = "block";
                var linkbtn = document.getElementById("lnkAttachment");
                linkbtn.style.display = "none";
                return false;

            }
            
    </script>

</telerik:RadCodeBlock>
<telerik:RadScriptManager runat="server" ID="RadScriptManager1">
</telerik:RadScriptManager>
<telerik:RadProgressManager ID="Radprogressmanager1" runat="server" />
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnAddClientComment">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnlUpdateCntComment" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadListViewClientComment">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnlUpdateCntComment" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="btnAddAuditorComment">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnlUpdateAuComment" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadListViewAuditor">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnlUpdateAuComment" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="btnSave">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnlCaseStatus" LoadingPanelID="RadAjaxLoadingPanel1" />
                <telerik:AjaxUpdatedControl ControlID="RadioButtonListStatus" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel Skin="Vista" runat="server" ID="RadAjaxLoadingPanel1" />
<div style="width: 100%; font-family: Arial; font-size: 12px;">
    <div style="padding: 8px; padding-left: 0px;">
        <asp:Label runat="server" ID="lblTitle" Text="<%$ Resources:Lang, Case_View%>" Font-Bold="true" />
    </div>
    <div style="border: solid 1px black;">
        <div style="background-color: Gray; padding: 5px; color: #FFFFFF; padding-left: 15px;
            padding-right: 15px;">
            <asp:Label ID="lblOrderID" runat="server" Font-Bold="true"></asp:Label>
        </div>
        <div style="padding: 15px;">
            <table width="100%">
                <tr>
                    <td height="40" width="200">
                        <div>
                            <asp:Label runat="server" ID="Label4" Text="<%$ Resources:Lang, Delivery_Date%>"
                                Font-Bold="true" />:
                            <asp:Label ID="lblDeliveryDate" runat="server"></asp:Label>
                        </div>
                    </td>
                    <td>
                        <div>
                            <font style="font-weight: bold">Collection Date:</font>
                            <asp:Label ID="lblCollectionDate" runat="server"></asp:Label>
                        </div>
                    </td>
                    <td>
                        <div style="width: 24px; height: 20px; float: right;">
                            <asp:LinkButton runat="server" ID="lnlPersonnel">
                                <img src="../images/icons/Personnel.png" border="0" />
                            </asp:LinkButton>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <table width="100%" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td>
                                    <hr style="size: 1px; color: #000;" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td width="55%" style="border-right: solid 1px #000; padding-right: 20px;">
                                                <!-- grid 1 -->
                                                <asp:DataGrid AutoGenerateColumns="false" Width="100%" AllowPaging="false" AllowSorting="false"
                                                    HeaderStyle-BackColor="White" ItemStyle-BackColor="White" AlternatingItemStyle-BackColor="White"
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right"
                                                    GridLines="None" BorderWidth="0" ItemStyle-Height="25" HeaderStyle-Height="30"
                                                    runat="server" ID="grid1">
                                                    <Columns>
                                                        <asp:BoundColumn HeaderText="<%$ Resources:Lang, Denom%>" DataField="StringDenomCode">
                                                        </asp:BoundColumn>
                                                        <asp:BoundColumn HeaderText="<%$ Resources:Lang, Consensio%>" DataField="Consensio"
                                                            DataFormatString="{0:C}"></asp:BoundColumn>
                                                        <asp:BoundColumn HeaderText="<%$ Resources:Lang, CPC%>" DataField="CPC" DataFormatString="{0:C}">
                                                        </asp:BoundColumn>
                                                        <asp:BoundColumn HeaderText="<%$ Resources:Lang, SST%>" DataField="SST" DataFormatString="{0:C}">
                                                        </asp:BoundColumn>
                                                    </Columns>
                                                </asp:DataGrid>
                                                <!-- grid 1 end -->
                                            </td>
                                            <td width="45%" style="padding-left: 0px;">
                                                <!-- grid 2 -->
                                                <asp:DataGrid AutoGenerateColumns="false" Width="100%" AllowPaging="false" AllowSorting="false"
                                                    HeaderStyle-BackColor="White" ItemStyle-BackColor="White" AlternatingItemStyle-BackColor="White"
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                                    GridLines="None" BorderWidth="0" ItemStyle-Height="25" HeaderStyle-Height="30"
                                                    runat="server" ID="grid2">
                                                    <Columns>
                                                        <asp:BoundColumn HeaderText="<%$ Resources:Lang, Expected_Return%>" HeaderStyle-Font-Underline="true"
                                                            DataField="ExpectedReturn" DataFormatString="{0:C}"></asp:BoundColumn>
                                                        <asp:BoundColumn HeaderText="<%$ Resources:Lang, Physical_Return%>" DataField="PhysicalReturn"
                                                            DataFormatString="{0:C}"></asp:BoundColumn>
                                                        <asp:BoundColumn HeaderText="<%$ Resources:Lang, Difference%>" DataField="Difference"
                                                            DataFormatString="{0:C}"></asp:BoundColumn>
                                                    </Columns>
                                                </asp:DataGrid>
                                                <!-- grid 2 end -->
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <hr style="size: 1px; color: #000" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <asp:Label runat="server" ID="pnlUpdateCntComment">
                            <table cellpadding="0" width="100%" cellspacing="0" border="0">
                                <tr>
                                    <td height="40" colspan="2" valign="top">
                                        <asp:Label runat="server" ID="Label5" Text="<%$ Resources:Lang, Client%>" Font-Bold="true" />
                                    </td>
                                </tr>
                                <tr>
                                    <td height="40" width="100" valign="top">
                                        <asp:Label runat="server" ID="Label6" Text="<%$ Resources:Lang, Comments%>" Font-Bold="true" />:
                                    </td>
                                    <td valign="top">
                                        <div style="float: left; width: 25px;">
                                            <img src="../images/icons/Comment_Client.png" border="0" />
                                        </div>
                                        <div style="float: left; width: auto; width: 80%" id="divEnterClientComment">
                                            <!-- Add comment list view -->
                                            <telerik:RadListView ID="RadListViewClientComment" runat="server" ItemPlaceholderID="ProductsHolder"
                                                OnItemCommand="RadListViewClientComment_ItemCommand" OnNeedDataSource="RadListViewClientComment_NeedDataSource"
                                                AllowPaging="false" DataKeyNames="CaseID">
                                                <LayoutTemplate>
                                                    <table width="100%" id="RadListViewClientComment">
                                                        <thead>
                                                            <tr>
                                                                <td colspan="4">
                                                                    <asp:LinkButton ID="btnAddClientComment" runat="server" Visible='<%#LinkShowCComment %>'
                                                                        CommandName="InitInsert" OnClick="btnAddClientComment_Click" Text="<%$ Resources:Lang, Add_Comment%>" />
                                                                </td>
                                                            </tr>
                                                        </thead>
                                                        <tbody style="width: 100%" runat="server" id="ProductsHolder">
                                                        </tbody>
                                                    </table>
                                                </LayoutTemplate>
                                                <ItemTemplate>
                                                    <tr>
                                                        <td colspan="2">
                                                            <i>
                                                                <%# Eval("ClientName")%></i>
                                                            <%# Eval("Comment")%>
                                                        </td>
                                                    </tr>
                                                </ItemTemplate>
                                                <InsertItemTemplate>
                                                    <tr>
                                                        <td colspan="2">
                                                            <asp:TextBox ID="txtCommenTitle" ValidationGroup="v1" runat="server" Width="80%"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="v1" runat="server"
                                                                ErrorMessage="*" ControlToValidate="txtCommenTitle"></asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="80%">
                                                            <asp:TextBox ID="txtCommentText" runat="server" Width="100%"></asp:TextBox>
                                                        </td>
                                                        <td>
                                                            <table>
                                                                <tr>
                                                                    <td>
                                                                        <asp:Button ID="btnInsertComment" runat="server" ValidationGroup="v1" CommandName="PerformInsert"
                                                                            Text="Insert" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:Button ID="btnCancelComment" runat="server" ValidationGroup="v1" CommandName="Cancel"
                                                                            Text="Cancel" CausesValidation="false" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </InsertItemTemplate>
                                            </telerik:RadListView>
                                            <!-- add comment list view end -->
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </asp:Label>
                        <asp:Label runat="server" ID="pnlUpdateUplFile">
                            <table cellpadding="0" width="100%" cellspacing="0" border="0">
                                <tr>
                                    <td width="100" height="40" valign="top">
                                        <asp:Label runat="server" ID="Label10" Text="<%$ Resources:Lang, Attachments%>" Font-Bold="true" />:
                                    </td>
                                    <td valign="top">
                                        <img alt="atachemnt" src="images/images.jpg" style="height: 21px; width: 24px" />
                                        <asp:LinkButton ID="lnkAttachment" Text="<%$ Resources:Lang, Add_File%>" runat="server"
                                            OnClick="lnkAttachment_Click" />
                                        <asp:Panel runat="server" Visible="false" ID="pnlClientFileUpload">
                                            <table>
                                                <tr>
                                                    <td>
                                                        <telerik:RadUpload ID="RadUpload1" runat="server" MaxFileInputsCount="5" OverwriteExistingFiles="false"
                                                            Localization-Add="Add another Attachment"  ControlObjectsVisibility="RemoveButtons, AddButton">
                                                            <Localization Add="Add another" />
                                                        </telerik:RadUpload>
                                                        <br />
                                                        <asp:Button ID="buttonUploadAttch" runat="server" OnClick="buttonUploadAttch_Click"
                                                            Text="Submit" /><asp:Button ID="btnCancelUpl" runat="server" OnClick="btnCancelUpl_Click"
                                                                Text="Cancel" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="labelNoResults" runat="server" Visible="True">No files chosen</asp:Label>
                                                        <asp:Repeater ID="repeaterResults" runat="server" Visible="False">
                                                            <HeaderTemplate>
                                                                <div class="title">
                                                                </div>
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <img alt="atachemnt" src="images/images.jpg" style="height: 21px; width: 24px" />
                                                                <asp:Label runat="server" ID="lblFileName" Text='<%#DataBinder.Eval(Container.DataItem, "AttachmentFullName")%>' />
                                                                <br />
                                                            </ItemTemplate>
                                                        </asp:Repeater>
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </td>
                                </tr>
                            </table>
                        </asp:Label>
                        <asp:Label runat="server" ID="pnlUpdateAuComment">
                            <table cellpadding="0" width="100%" cellspacing="0" border="0">
                                <tr>
                                    <td height="40" valign="top">
                                        <asp:Label runat="server" ID="Label8" Text="<%$ Resources:Lang, Auditor%>" Font-Bold="true" />
                                    </td>
                                    <td valign="top">
                                    </td>
                                </tr>
                                <tr>
                                    <td width="100" height="40" valign="top">
                                        <asp:Label runat="server" ID="Label9" Text="<%$ Resources:Lang, Comments%>" Font-Bold="true" />
                                    </td>
                                    <td valign="top">
                                        <div style="float: left; width: 25px;">
                                            <img src="../images/icons/Comment_Auditor.png" border="0" />
                                        </div>
                                        <div style="float: left; width: auto; width: 80%" id="div1">
                                            <!-- Add comment list view -->
                                            <telerik:RadListView ID="RadListViewAuditor" runat="server" ItemPlaceholderID="ProductsHolder"
                                                OnItemCommand="RadListViewAuditor_ItemCommand" OnNeedDataSource="RadListViewAuditor_NeedDataSource"
                                                AllowPaging="false" DataKeyNames="CaseID">
                                                <LayoutTemplate>
                                                    <table width="100%" id="RadListViewAuditor">
                                                        <thead>
                                                            <tr>
                                                                <td colspan="4">
                                                                    <asp:LinkButton ID="btnAddAuditorComment" runat="server" CommandName="InitInsert"
                                                                        OnClick="btnAddAuditorComment_Click" Visible='<%#LinkShowAComment %>' Text="<%$ Resources:Lang, Add_Comment%>" />
                                                                </td>
                                                            </tr>
                                                        </thead>
                                                        <tbody style="width: 100%" runat="server" id="ProductsHolder">
                                                        </tbody>
                                                    </table>
                                                </LayoutTemplate>
                                                <ItemTemplate>
                                                    <tr>
                                                        <td colspan="2">
                                                            <i>
                                                                <%# Eval("ClientName")%></i>
                                                            <%# Eval("Comment")%>
                                                        </td>
                                                    </tr>
                                                </ItemTemplate>
                                                <InsertItemTemplate>
                                                    <tr>
                                                        <td colspan="2">
                                                            <asp:TextBox ID="txtCommenTitle" ValidationGroup="v2" runat="server" Width="80%"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="v2" runat="server"
                                                                ErrorMessage="*" ControlToValidate="txtCommenTitle"></asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="80%">
                                                            <asp:TextBox ID="txtCommentText" runat="server" Width="100%"></asp:TextBox>
                                                        </td>
                                                        <td>
                                                            <table>
                                                                <tr>
                                                                    <td>
                                                                        <asp:Button ID="btnInsertAuditorComment" runat="server" ValidationGroup="v2" CommandName="PerformInsert"
                                                                            Text="Insert" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:Button ID="btnCancelAuditorComment" ValidationGroup="v2" runat="server" CommandName="Cancel"
                                                                            Text="Cancel" CausesValidation="false" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </InsertItemTemplate>
                                            </telerik:RadListView>
                                            <!-- add comment list view end -->
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <div style=" float:right; ">
                            <asp:Panel runat="server" ID="pnlCaseStatus" Visible="false">
                                <table>
                                    <tr>
                                        <td>
                                            <asp:RadioButtonList ID="RadioButtonListStatus" RepeatDirection="Horizontal" runat="server"
                                                Width="290px">
                                                <asp:ListItem Text="Open" Value="Open"></asp:ListItem>
                                                <asp:ListItem Text="Awaiting Information" Value="Awaiting"></asp:ListItem>
                                                <asp:ListItem Text="Close" Value="Close"></asp:ListItem>
                                            </asp:RadioButtonList>
                                        </td>
                                        <td align="right">
                                            <asp:ImageButton runat="server" ID="btnSave" ImageUrl="~/images/SaveEnabled.jpg"
                                                OnClick="btnSave_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel runat="server" ID="pnlCaseStatus2" Visible="false">
                                <div style="float: right; margin-right: 20px; width: auto;">
                                    <table>
                                        <tr>
                                            <td width="50">
                                                <b>Status</b>
                                            </td>
                                            <td>
                                                <img runat="server" id="imgStatus" src="../images/icons/Case_Close.png" />
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblStatus" Text="Case Closed" />
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </asp:Panel>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    <Windows>
        <telerik:RadWindow ID="RadWindowExpectedReturn" runat="server" Title="Expected Return"
            Height="400px" Width="300px" Left="150px" ReloadOnShow="False" ShowContentDuringLoad="false"
            Modal="true" Skin="Telerik" />
    </Windows>
</telerik:RadWindowManager>
